<VirtualHost *:443>
    SSLEngine on
    SSLProtocol {{ ssl_protocols }}
    # Use secure TLSv1.1 and TLSv1.2 ciphers
    SSLCipherSuite {{ ssl_ciphers }}
    SSLHonorCipherOrder on
    Header always add Strict-Transport-Security "max-age=31536000; preload"

    SSLCertificateFile /etc/pki/tls/certs/copr.fedorainfracloud.org.crt
    SSLCertificateKeyFile /etc/pki/tls/private/copr.fedorainfracloud.org.key
    SSLCertificateChainFile /etc/pki/tls/certs/copr.fedorainfracloud.org.intermediate.crt

    ServerName copr.fedorainfracloud.org

    WSGIPassAuthorization On
    WSGIScriptAlias / /usr/share/copr/coprs_frontend/application
    WSGIProcessGroup 127.0.0.1

    <Location /api>
        WSGIProcessGroup api
    </Location>
    <Location /backend>
        WSGIProcessGroup backend
    </Location>
    <Location /stats_rcv>
        WSGIProcessGroup stats
    </Location>
    <Location /tmp>
        WSGIProcessGroup tmp
    </Location>

    #ErrorLog logs/error_coprs
    #CustomLog logs/access_coprs common

    <Directory /usr/share/copr>
        WSGIApplicationGroup %{GLOBAL}
        Require all granted
    </Directory>

    RewriteEngine on
    RewriteRule ^/coprs/sgallagh/cockpit-preview/repo/(.*)/.*\.repo$ /coprs/g/cockpit/cockpit-preview/repo/$1/ [R=301]
    RewriteRule ^/coprs/sgallagh/cockpit-preview/(.*)$ /coprs/g/cockpit/cockpit-preview/$1 [R=301]
</VirtualHost>

<VirtualHost *:443>
    SSLEngine on
    SSLProtocol {{ ssl_protocols }}
    # Use secure TLSv1.1 and TLSv1.2 ciphers
    SSLCipherSuite {{ ssl_ciphers }}
    SSLHonorCipherOrder on
    Header always add Strict-Transport-Security "max-age=31536000; preload"

    SSLCertificateFile /etc/pki/tls/certs/copr.fedorainfracloud.org.crt
    SSLCertificateKeyFile /etc/pki/tls/private/copr.fedorainfracloud.org.key
    SSLCertificateChainFile /etc/pki/tls/certs/copr.fedorainfracloud.org.intermediate.crt

    ServerAlias copr.fedoraproject.org

    Redirect 302 / https://copr.fedorainfracloud.org/
</VirtualHost>


